-
Notifications
You must be signed in to change notification settings - Fork 743
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgraded various maven plugin versions to latest available. #1453
Upgraded various maven plugin versions to latest available. #1453
Conversation
Don't do that, Groovy as used by Gradle doesn't support 1.8 features very well |
Ok let me fix it. I did it as using Java 21 where 1.7 is not supported anymore 1.8 will be using jdk 17 |
Yeah, I really wonder if anyone is ever going to use anything after 17 in
production...
|
I reverted back the source and target versions to 1.7 |
305b6ec
to
0d4deb2
Compare
Are you sure this is still an issue ? What 's the problem exactly ? |
What you linked is related to the use of lambdas in gradle plugins. I don't think it's related to the version of Java javacpp itself is written with. Or did I miss something ? |
If you can figure out a nicer way to make sure the build fails on lambda expressions, we could add that instead |
The build of what ? |
The build for JavaCPP, we can't use lambda expressions in it, see issue bytedeco/gradle-javacpp#23 |
And there's most likely similar issues with Android, Kotlin, Scala, etc, so until we have a really good reason to move away from Java SE 7, I'll just stick with it. |
6e24bac
to
97c7701
Compare
97c7701
to
a7786a3
Compare
Maybe one of the reasons/ideas to upgrade to at least 1.8 is to use latest graalvm-21 (and later in future) and start building native-images for the code base, although not sure what are your long-term plans. |
I'm not having any issues with GraalVM 21. What error do you get when running this sample code? |
@saudet - I switched to Oracle GraalVM 21.0.1 (I use SDKMAN to managed different version simultaneously)
So I upgraded maven-compiler-plugin to 3.12.1 which defaults to 8: And I got this build log(note the recommendations):
|
@saudet - the thing with graalvm is that latest v21 requires at least java 1.8 code... |
Well, you've just tried it yourself and it works fine with classes compiled for Java SE 7, so there's no issues, right? |
This issue is very specific to plugin authoring in Java: gradle sometimes tracks the versions of codes to determine if the output of a task is up to date, like the code of the task itself. And it's apparently impossible to determine the version of a code written as a Java lambda expression. So we cannot write tasks as Java lambda expressions in Gradle plugin. Gradle plugins written in Kotlin or Groovy can use lambda expressions. So this issue does not prevent JavaCPP itself to be written in Java 8+ and to contain lambdas. And does not prevent JavaCPP Gradle plugin to be written in Java 8 either as long as tasks are not written as lambdas. Java 7 bytecode is still supported by OpenJDK 21 but we cannot target 7 with javac anymore. So we need Java 17- to compile JavaCPP. I don't know anything about GraalVM, but I guess it's the same ? I doubt Android or any current technology would cause any problem if JavaCPP is targetted to Java 8 or 11 but in the other hand, as long as JavaCPP is in "maintenance" mode and that all platform still can run Java 7 bytecode, there is little reason to upgrade. |
Upgraded source and target from 1.7 to 1.8 for maven-compiler-plugin.